package com.itheima;

import com.itheima.list.ListNode;
import org.junit.Test;

public class Topic206 {

    public ListNode reverseList(ListNode head) {

        ListNode prev = null;
        ListNode curr = head;


        while(curr != null) {
            ListNode next = curr.next;

            curr.next = prev;
            prev = curr;
            curr = next;


        }

        return prev;
    }


    @Test
    public void test() {

    }
}
